﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CJJCH.Web.Manage
{
    public class PowerBase : System.Web.UI.Page
    {
        public Guid SessionManagerID;
        public string SessionRealName;
        protected override void OnPreLoad(EventArgs e)
        {
            if (this.Page != null)
            {
                SessionManagerID = new Guid();
                try
                {
                    SessionManagerID = new Guid(Session["ManagerID"].ToString());
                    SessionRealName = Session["RealName"].ToString();
                }
                catch { }
                if (SessionManagerID == null || SessionManagerID == new Guid())
                {
                    Response.Write("<script type='text/javascript'>var url=window.location.href;window.top.location.href='http://" + Request.ServerVariables["HTTP_HOST"].ToString() + "/Manage/Login.aspx'</script>");
                    Response.End();
                }
                else
                {
                    string strUrl = Request.RawUrl.Trim().ToLower().Substring(1);
                }
            }
            base.OnPreLoad(e);
        }
        protected void ToDoFinish(string error, bool urlFlag, string url)
        {
            if (error.Trim()!="")
            {
                if (urlFlag)
	            {
		             LTP.Common.WindowClass.WindowGoHref(error,url);
	            }
                else
	            {
                     LTP.Common.WindowClass.WindowBack(error);
	            }
            }
            else
            {
                LTP.Common.WindowClass.WindowGoHref(url);
            }
        }
    }
}